package com.jingxi.common.rand;

import java.math.BigDecimal;

public class RandomUtils {

    public static String generateCode(int length){
        StringBuilder sb = new StringBuilder();
        for(int x = 0 ;x++ < length ;){
            double random = Math.random();
            int i = new BigDecimal(random).multiply(new BigDecimal(10.0)).intValue();
            sb.append(i);
        }
        return sb.toString();
    }

}
